home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_12
/
8n12037a
< prev
next >
Wrap
Text File
|
1990-10-16
|
644b
|
27 lines
/* clear bit 3 in the data direction register */
/* to make line 3 (from device 1) in the general */
/* purpose I/O register an input line. Just for */
/* fun, do it four different, but equivalent, ways. */
#include "mfp_defs.h" /* MFP address definitions */
#include "mfp_macs.h" /* MFP macro definitions */
#define BIT3_MASK 0xf7 /* mask for clearing bit 3 */
dev_input()
{
*(unsigned char *)DDR &= BIT3_MASK;
REGVAL(DDR) &= BITOFF_MASK(DEVICE_1);
CLR_BITS(DDR,BITOFF_MASK(DEVICE_1));
BIT_CLR(DDR,DEVICE_1);
}